package com.aaa.controller;


import com.aaa.entity.ContractRent;
import com.aaa.entity.Result;
import com.aaa.query.ContractQuery;
import com.aaa.service.IContractRentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author auto
 * @since 2021-01-29
 */
@RestController
@RequestMapping("rentPublic")
public class ContractRentPublicController {

    @Autowired
    IContractRentService service;

    /**
     *  租入合同 公有资产 查询所有
     * @return
     */
    @RequestMapping("/listAll")
    public Result listAllRentPublic(){

        return service.listAllRentPublic();
    }

    /**
     *  公有资产租入合同 添加合同
     * @param contract
     */

    @RequestMapping("/add")
    public Result addRentPublic(@RequestBody ContractRent contract){

        return service.addRentPublic(contract);
    }

    /**
     *  公有资产租入合同 删除合同
     * @param number
     */

    @RequestMapping("/del")
    public Result deleteRentPublic(String number){

        return service.deleteRent(number);
    }

    /**
     *  公有资产租入合同 修改合同
     * @param  contract
     */

    @RequestMapping("/update")
    public Result updateRent(@RequestBody ContractRent contract){

        return service.updateRentPublic(contract);
    }

    /**
     *  分页 + 模糊查询
     * @param  query
     * @return
     */

    @RequestMapping("/query")
    public Result RentPublicQuery(@RequestBody ContractQuery query){

        return service.rentPublicQuery(query);
    }



}

